package cn.restcloud.example.dubbo;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;

import cn.restcloud.example.model.UserModel;
import cn.restcloud.framework.core.util.DateTimeUtil;
import cn.restcloud.framework.view.base.DocAndView;
import cn.restcloud.framework.view.util.ViewUtil;


@Component
@Service 
public class DubboServerUserImpl implements IDubboServerUser {

	@Override
	public String getUserInfo(String userId) {
		return userId+" "+DateTimeUtil.getNow();
	}

	@Override
	public DocAndView getUserObj(String userId) {
		return ViewUtil.getSucessView(userId);
	}

	@Override
	public DocAndView getUserModel(UserModel userObj) throws Exception {
		return ViewUtil.getJsonView(userObj);
	}

}
